<?php


class FrmRegisterComponent {
    private $easyFormReg;
    private $easyFormUnReg;




    public function __construct($componentsList=array()) {
        $this->easyFormReg=new EasyForm($name="RegisterScriptSCI", $id="RegisterScriptSCI", $method="post", $action="../Events/EventsFrmRegisterScripSCI.php", $fieldSetLegend="Register a new component", $target="", $class="", $enctype="", $validation="");
            $this->easyFormReg->addInput($colSpan="", $label="Component Name:", $name="componentName", $id="componentName", $value="", $readOnly="", $size="", $maxLength="", $class="");
            $this->easyFormReg->addInput($colSpan="", $label="Location:", $name="componentLocation", $id="componentLocation", $value="", $readOnly="", $size="150", $maxLength="", $class="");
            $this->easyFormReg->addButton($colSpan="2", $label=" ", $name="register", $id="register", $alt="register", $value="register", $note="", $type="button", $disabled="",$class="", $imageSrc="", $title="", $imageWidth="", $imageHeight="", $imageBorder="0", $events=array("onclick"=>"POSTMethodSend('register','componentName','componentLocation','divContent','../Events/EventsFrmRegisterComponent.php')"));
        
        $this->easyFormUnReg=new EasyForm($name="UnRegisterScriptSCI", $id="UnRegisterScriptSCI", $method="post", $action="../Events/EventsUnFrmRegisterScripSCI.php", $fieldSetLegend="Unregister a component", $target="", $class="", $enctype="", $validation="");
            $this->easyFormUnReg->addSelectionList($colSpan="", $label="Component to unregistrer", $name="componentsList", $id="componentsList", $class="", $size="", $multiple="", $disabled="", $tabindex="", $events=array());
            $this->easyFormUnReg->setOptionsSelectionList($label="Component to unregistrer", $optionsSelectionList=$componentsList, $selected="");
            $this->easyFormUnReg->addButton($colSpan="2", $label=" ", $name="unregister", $id="unregister", $alt="unregister", $value="unregister", $note="", $type="button", $disabled="",$class="", $imageSrc="", $title="", $imageWidth="", $imageHeight="", $imageBorder="0", $events=array("onclick"=>"POSTMethodSend('unregister','componentsList','divContent','../Events/EventsFrmRegisterComponent.php')"));
        
    }
    public function setVisible($visible=TRUE){
        if($visible==TRUE){
            $this->easyFormReg->show($cols="1", $rows="3");
             //-------
            $sections=explode("_", $_SESSION['sections']);
            if(count($sections)==3){   
                $this->easyFormUnReg->show($cols="1", $rows="3");
            }
        
        }
    }
    
}

?>
